package com.io;

import java.io.*;

/**
 * 重定向标准输入流，将”d:\test\my Poem.txt”文件里的内容输出到控制台上。
 *
 * @author: Jovi
 * @createTime: 2017-06-20 15:30
 **/
public class ReIn {
    public static void main(String[] args) {
        try {
            FileInputStream fis = new FileInputStream("poem.txt");
            System.setIn(fis);
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String line;
            try {
                while ((line = br.readLine()) != null) {
                    System.out.println(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    }
}
